home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / des3.zip / DES3.H < prev    next >
C/C++ Source or Header  |  1995-04-01  |  3KB  |  91 lines

  1. #ifndef _MODULE_DES3_H_
  2. #define _MODULE_DES3_H_
  3. /*
  4.  *             des3 - NBS Data Encryption Standard Library
  5.  *
  6.  *         Copyright (c) 1992,93,94 by SWS. All Rights Reserved.
  7.  *       Stefan Wolf Software; Gartenstr 22; D-61449 Steinbach/Ts.
  8.  *           FAX: +49 (0) 6171 980483; CI$ Email: 100111,140
  9.  *
  10.  *    Synopsis:    desinit(key)
  11.  * Description: intializes all arrays and permutation tables for 
  12.  *              single DES
  13.  *       Input: key -  64-bit DES key
  14.  *      Output: 0 if OK; >0 if a (semi) weak was selected
  15.  *
  16.  *    Synopsis:    des3init(key)
  17.  * Description: intializes all arrays and permutation tables for
  18.  *              triple DES
  19.  *       Input: key -  128-bit DES key
  20.  *      Output: 0 if OK; >0 if a (semi) weak was selected
  21.  *
  22.  *    Synopsis: ecbXcode(inblock,outblock)
  23.  * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to
  24.  *              64-bit outblock using single DES in ECB mode
  25.  *          Input: inblock  - pointer to 64-bit buffer of input data
  26.  *              outblock - pointer to 64-bit buffer for output data
  27.  *      Output: 0 if OK                                        
  28.  *
  29.  *    Synopsis: ecb3Xcode(inblock,outblock)
  30.  * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to
  31.  *              64-bit outblock using triple DES in ECB mode
  32.  *          Input: inblock  - pointer to 64-bit buffer of input data
  33.  *              outblock - pointer to 64-bit buffer for output data
  34.  *      Output: 0 if OK
  35.  *
  36.  *    Synopsis: cbcXcode(inblock,outblock,ivec)
  37.  * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to
  38.  *              64-bit outblock using single DES in CBC mode
  39.  *          Input: inblock  - pointer to 64-bit buffer of input data
  40.  *              outblock - pointer to 64-bit buffer for output data
  41.  *              ivec     - pointer to 64-bit initilization vector
  42.  *      Output: 0 if OK
  43.  *
  44.  *    Synopsis: cbc3Xcode(inblock,outblock,ivec)
  45.  * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to
  46.  *              64-bit outblock using triple DES in CBC mode
  47.  *          Input: inblock  - pointer to 64-bit buffer of input data
  48.  *              outblock - pointer to 64-bit buffer for output data
  49.  *              ivec     - pointer to 64-bit initilization vector
  50.  *      Output: 0 if OK
  51.  *
  52.  */
  53.  
  54. typedef unsigned char uchar;
  55.  
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif /* __cplusplus */
  59.  
  60. #if defined(WIN16)
  61. #define DECL int far pascal
  62. #define UCHAR uchar far
  63. #endif /* WIN16 */
  64.  
  65. #if defined(WIN32)
  66. /* remove pascal for MS VC */
  67. #define DECL int pascal
  68. #define UCHAR uchar
  69. #endif /* WIN32 */
  70.  
  71. #if !defined(WIN16) && !defined(WIN32)
  72. #define DECL int
  73. #define UCHAR uchar
  74. #endif /* !WIN16 && !WIN32 */
  75.  
  76. DECL desinit(UCHAR *key1);
  77. DECL ecbencode(UCHAR *inblock, UCHAR *outblock);
  78. DECL ecbdecode(UCHAR *inblock, UCHAR *outblock);
  79. DECL cbcencode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);
  80. DECL cbcdecode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);
  81. DECL des3init(UCHAR *key3);
  82. DECL ecb3encode(UCHAR *inblock, UCHAR *outblock);          
  83. DECL ecb3decode(UCHAR *inblock, UCHAR *outblock);
  84. DECL cbc3encode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);
  85. DECL cbc3decode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);
  86.  
  87. #ifdef __cplusplus
  88. }
  89. #endif /* __cplusplus */
  90. #endif /* _MODULE_DES3_H_ */
  91.